<template>
  <div>点击次数：{{ counter }}</div>
  <div>双倍点击的次数：{{ doubleCounter }}</div>
  <button @click="add(1)">+1</button>
  <button @click="cut(-1)">-1</button>
</template>

<script>
import useCounter from "./hooks/useCounter";
export default {
  setup() {
    // 计数器demo
    const { counter, doubleCounter, cut, add } = useCounter();
    return {
      counter,
      doubleCounter,
      cut,
      add,
    };
  },
};
</script>

<style>
</style>